// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package androidx.gdata.blogger;

import androidx.gdata.Category;
import androidx.gdata.Author;
import androidx.gdata.LinkUrl;

public class BlogEntryBuilder {
  private String id;
  private String published;
  private String updated;
  private AppEdited appEdited;
  private AppControl appControl;
  private ThreadTotal tt;
  private Category[] categories;
  private Author author;
  private BlogContent content;
  private String title;
  private String summary;
  private LinkUrl[] links;

  public BlogEntryBuilder() {
  }

  public BlogEntryBuilder setId(String id) {
    this.id = id;
    return this;
  }

  public BlogEntryBuilder setAppControl(AppControl appControl) {
    this.appControl = appControl;
    return this;
  }

  public BlogEntryBuilder setIsDraft(boolean isDraft) {
    appControl = new AppControl(new AppDraft(isDraft ? "yes" : "no"));
    return this;
  }

  public BlogEntryBuilder setPublished(String published) {
    this.published = published;
    return this;
  }

  public BlogEntryBuilder setUpdated(String updated) {
    this.updated = updated;
    return this;
  }

  public BlogEntryBuilder setAppEdited(AppEdited appEdited) {
    this.appEdited = appEdited;
    return this;
  }

  public BlogEntryBuilder setThreadTotal(ThreadTotal tt) {
    this.tt = tt;
    return this;
  }

  public BlogEntryBuilder setCategories(Category[] categories) {
    this.categories = categories;
    return this;
  }

  public BlogEntryBuilder setAuthor(Author author) {
    this.author = author;
    return this;
  }

  public BlogEntryBuilder setBlogContent(BlogContent content) {
    this.content = content;
    return this;
  }

  public BlogEntryBuilder setTitle(String title) {
    this.title = title;
    return this;
  }

  public BlogEntryBuilder setSummary(String summary) {
    this.summary = summary;
    return this;
  }

  public BlogEntryBuilder setLinks(LinkUrl[] links) {
    this.links = links;
    return this;
  }

  public BlogEntry build() {
    return new BlogEntry(id, published, updated, appEdited, appControl, categories, title, summary, links
        , author, tt, content);
  }

}
